<template>
  <div class="chooseSelf-container">
    <babyRadio
      :res-val.sync="specialResult"
      :items.sync="items"
      :fix-width="200"
    ></babyRadio>
  </div>
</template>
<script>
import babyRadio from '@/components/common/babyRadio/babyRadioLine';

export default {
  components: {
    babyRadio
  },
  props: {
    commodity: [Array],
    selfRes: {}
  },
  data() {
    return {
      specialResult: 0,
      items: []
    };
  },
  watch: {
    commodity() {
      this.items = this.commodity.map(it => {
        it.label = it.commodity_name;
        it.value = it.disease_id;
        return it;
      });
    },
    specialResult(v) {
      this.$emit('update:selfRes', v);
    }
  }
};
</script>
<style lang="scss" scoped>
.chooseSelf-container {
  background-color: #fff;
  padding: 20px 10px;
  font-size: 30px;
}
</style>
